-- GENERATED SPELL FOR [Ulathek] --


function spell0_14523(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14523', 3000, 1)
end

function spell1_14523(pUnit, Event) --@Summon Imp,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(11939,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_14523', 1, 1)
end

function spell2_14523(pUnit, Event) --@Unholy Frenzy,n/a--
pUnit:FullCastSpellOnTarget(8699,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14523', 20000, 1)
end

function Sorts_14523(pUnit, Event)
local choix_sorts_14523 = math.random(0, 2)
if choix_sorts_14523 == 0 then
pUnit:RegisterEvent('spell0_14523', 1, 1)
end
if choix_sorts_14523 == 1 then
pUnit:RegisterEvent('spell1_14523', 1, 1)
end
if choix_sorts_14523 == 2 then
pUnit:RegisterEvent('spell2_14523', 1, 1)
end
end

function mob14523_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_14523', math.random(1500, 3000), 1)
end

function mob14523_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob14523_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob14523_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(14523, 1, 'mob14523_Action')
RegisterUnitEvent(14523, 2, 'mob14523_Leave')
RegisterUnitEvent(14523, 3, 'mob14523_Kill')
RegisterUnitEvent(14523, 4, 'mob14523_Die')
